const express = require('express');
const router = express.Router();
const recipeController = require('../controllers/recipeController');
const auth = require('../middlewares/auth');

// 公开路由
router.get('/', recipeController.getRecipes);
router.get('/recommend', auth, recipeController.getRecommendRecipes);
router.get('/my/recipes',  auth,recipeController.getMyRecipes);
router.get('/:id', recipeController.getRecipeById);

// 需要认证的路由

router.post('/', auth, recipeController.createRecipe);
router.put('/:id', auth, recipeController.updateRecipe);
router.delete('/:id', auth, recipeController.deleteRecipe);

module.exports = router; 